//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Query Application Block
//===============================================================================

using System;
using System.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Design;

namespace EntLibContrib.Query.Configuration
{
	/// <summary>
	/// Configuration data defining FileQueryData.
	/// This configuration section adds the data file
	/// </summary>    
	public abstract class FileQueryData : QueryData
	{
		#region Constants
		private const string dataFileProperty = "dataFile";
		#endregion

		#region Properties
		/// <summary>
		/// Data file to use.
		/// </summary>
		/// <value>Data file.</value>
		[ConfigurationProperty(dataFileProperty, IsRequired = true)]
        [System.ComponentModel.Editor(CommonDesignTime.EditorTypes.FilteredFilePath, CommonDesignTime.EditorTypes.UITypeEditor)]
        [ResourceDescription(typeof(DesignResources), "FileQueryDataDataFileDescription")]
        [ResourceDisplayName(typeof(DesignResources), "FileQueryDataDataFileDisplayName")]
		public string DataFile
		{
			get { return (string)base[dataFileProperty]; }
			set { base[dataFileProperty] = value; }
		}
		#endregion

		/// <summary>
		/// Initializes a new instance of the <see cref="FileQueryData"/> class.
		/// </summary>
		protected FileQueryData ()
		{
		}

		/// <summary>
		/// Initialize a new instance of the <see cref="FileQueryData"/> class with a name and the type of <see cref="IQuery"/>.
		/// </summary>
		/// <param name="name">The name of the configured <see cref="IQuery"/>.</param>
		/// <param name="type">The type of <see cref="IQuery"/>.</param>
		protected FileQueryData(string name, Type type)
			: this(name, type, string.Empty, string.Empty, string.Empty)
		{
		}

		/// <summary>
		/// Initialize a new instance of the <see cref="FileQueryData"/> class.
		/// </summary>
		/// <param name="name">The name of the <see cref="FileQueryData"/>.</param>
		/// <param name="type">The type of <see cref="IQuery"/>.</param>
		/// <param name="customCommandName">Name of the custom command.</param>
		/// <param name="parameterSetName">Name of the parameter set.</param>
		/// <param name="dataFile">The data file.</param>
		protected FileQueryData(string name, Type type, string customCommandName, string parameterSetName, string dataFile)
			: base(name, type, customCommandName, parameterSetName)
		{
			this.DataFile = dataFile;
		}
	}
}